from online import models

def randomQuestion(num,subject):
    """
        多种排序方式获取题库
    """
    # num=那种方式排序
    # subject=学科id
    order_by = ['id', '-right', 'A', 'C', '-id']
    exam_list = models.ExamBank.objects.all().filter(subject=subject).order_by(order_by[num])
    return exam_list
